package com.neusoft.reportserver.controller;


import com.neusoft.reportserver.dto.ReportSearch;
import com.neusoft.reportserver.dto.RespBean;
import com.neusoft.reportserver.entity.Report;
import com.neusoft.reportserver.service.IReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 销售日报表 前端控制器
 * </p>
 *
 * @author liuxp
 * @since 2021-07-12
 */
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    IReportService reportService;

    @PostMapping("/addReport")
    RespBean addReport(@RequestBody Report report){
        return reportService.addReport(report);
    }

    @PostMapping("/deleteReport/{id}")
    RespBean deleteReport(@PathVariable int id){
        return reportService.deleteReport(id);
    }

    @PostMapping("/updateReport")
    RespBean updateReport(@RequestBody Report report){
        return reportService.updateReport(report);
    }

    @PostMapping("/searchReport")
    RespBean searchReport(@RequestBody ReportSearch reportSearch){
        System.out.println(reportSearch);
        return reportService.searchReport(reportSearch);
    }

}

